package com.base.cn.platform.os.common.log.aop;

import javassist.NotFoundException;

/**
 * 文 件 名:LogUtils
 * 创 建 人:hackeridear
 * 创建日期:2018-12-05
 * 描   述:LogUtils 修改日志
 * 修 改 人:
 * 修改日期:
 * 版 本 号:v 1.0.0
 */
public class LogUtils {

    private static LogUtils mInstance;

    private LogUtils() {}

    public static LogUtils get() {
        if (mInstance == null) {
            synchronized (LogUtils.class) {
                if (mInstance == null) {
                    mInstance = new LogUtils();
                }
            }
        }
        return mInstance;
    }

    public void setAttr(String filedName,String filedValue) throws NotFoundException {
        String className = Thread.currentThread().getStackTrace()[2].getClassName();
        String methodName = Thread.currentThread().getStackTrace()[2].getMethodName();
        AnnotationUtils.get().setAnnotatioinFieldValue(className, methodName, OpLog.class.getName(), filedName, filedValue);
    }
}